using Newtonsoft.Json;
using StructuredProgrammingAssignment.App_Start;
using StructuredProgrammingAssignment.Helpers;
using System;
using System.Collections.Generic;

namespace StructuredProgrammingAssignment.Linq
{
	partial class UserStuff
	{
		partial void OnCreated() {
			this._CreatedDateTime = DateTime.Now;
			this._ModifiedDateTime = DateTime.Now;
		}

		partial void OnPropertiesChanged() {
			bool limitCustomProperties = SPConfig.Settings.LimitCustomProperties;
			Dictionary<string, bool> propertyList = SPConfig.Settings.UserStuffProperties.ValueDictionary();

			this._Properties = SPHelper.ParseProperties(this._Properties, propertyList, limitCustomProperties);
		}
	} // UserStuff

	partial class UserAccount
	{
		partial void OnCreated() {
			this._CreatedDateTime = DateTime.Now;
			this._ModifiedDateTime = DateTime.Now;
		}

		partial void OnPropertiesChanged() {
			bool limitCustomProperties = SPConfig.Settings.LimitCustomProperties;
			Dictionary<string, bool> propertyList = SPConfig.Settings.UserAccountProperties.ValueDictionary();

			this._Properties = SPHelper.ParseProperties(this._Properties, propertyList, limitCustomProperties);
		}
	} // UserAccount

	partial class Category
	{
		partial void OnCreated() {
			this._CreatedDateTime = DateTime.Now;
			this._ModifiedDateTime = DateTime.Now;
		}

		partial void OnPropertiesChanged() {
			bool limitCustomProperties = SPConfig.Settings.LimitCustomProperties;
			Dictionary<string, bool> propertyList = SPConfig.Settings.CategoryProperties.ValueDictionary();

			this._Properties = SPHelper.ParseProperties(this._Properties, propertyList, limitCustomProperties);
		}
	} // Category

	partial class Order
	{
		partial void OnCreated() {
			this._CreatedDateTime = DateTime.Now;
			this._ModifiedDateTime = DateTime.Now;
		}

		partial void OnPropertiesChanged() {
			bool limitCustomProperties = SPConfig.Settings.LimitCustomProperties;
			Dictionary<string, bool> propertyList = SPConfig.Settings.OrderProperties.ValueDictionary();

			this._Properties = SPHelper.ParseProperties(this._Properties, propertyList, limitCustomProperties);
		}
	} // Order
}
